1. Field of the Invention
The present invention relates generally to a method for resizing an image using an inverse discrete cosine transform (IDCT) and, more particularly, but not by way of limitation, to a method for enlarging an original image to an arbitrary resolution by performing an IDCT operation after making the encoding types of the original source image and the macro blocks identical.
2. Description of the Related Art
A general method for enlarging an image is to process the image in the spatial frequency domain using the discrete cosine transform (DCT). An original image is divided into two-dimensional image blocks, for example, image blocks of size 8×8 pixels, and a DCT operation is performed on each of the image blocks to produce a DCT coefficient block having low and high spatial frequency components.
It is well known that the combination of DCT and quantization results in many of the frequency components being zero, especially the coefficients for high spatial frequencies, because most of the energy in the original image is typically concentrated in low spatial frequencies.
A common method taking advantage of this feature appends columns and rows of zeros to the high frequency area in the DCT coefficient block for increasing the size of the DCT coefficient block to integral multiples of 8×8, for example, 16×16 or 24×24. An inverse DCT operation on the increased-size DCT coefficient block leads to an enlarged image block.
The frequency-domain method is expected to gather popularity for resizing images because the algorithm is relatively simple and does not deteriorate the quality of the enlarged image. Methods for resizing images in the spatial frequency domain are disclosed in, for example, U.S. Pat. No. 5,737,019 issued on Apr. 7, 1998, Korea patent publication No. 1999-64158 published on Jul. 25, 1999, and Korea patent publication No. 2001-49039 published on Jun. 15, 2001.
While the methods disclosed in the referenced patents and publications may show good results, there is a major limitation that an image cannot be enlarged to an arbitrary size and can only be enlarged to integral multiple times its original size. Also, adequate schemes for preventing possible distortions in the enlarged image after the image is enlarged to an arbitrary size have not been addressed yet.
In the meantime, a new image resizing method has been proposed in Korea patent application No. 2002-63600 filed on Oct. 17, 2002 to solve those problems. FIG. 1 depicts the structure of an image resizing apparatus such as an image scaler using this method. The apparatus comprises a discrete cosine transform (DCT) unit 10, a zero appending unit 11, a k-coefficient multiplying unit 12, and an inverse discrete cosine transform (IDCT) unit 13.
The DCT unit 10 divides an original source image into macro blocks of size M×N pixels and performs a DCT operation on each of the macro blocks to produce a corresponding DCT coefficient block. The zero appending unit 11 appends rows and columns of zeros to the high frequency area in each DCT coefficient block as many as required.
The k-coefficient multiplying unit 12 calculates the k-coefficient for the zero-appended DCT coefficient block and multiplies each element of the zero-appended DCT coefficient block by the k-coefficient. An enlarged image block of size P×Q pixels is obtained by an IDCT operation of the IDCT unit 13 on the zero-appended DCT coefficient block multiplied by the k-coefficient.
The above procedure leads to an image enlarged to an arbitrary resolution without having the resulting enlarged image distorted.
Original source images received through digital broadcasts or reproduced from an optical disk such as a DVD may be encoded as either a frame type or a field type depending upon the source contents. For example, movies displayed by the progress scan are frame-type encoded and video camera images displayed by the interlaced scan are field-type encoded.
A macro block, which is the basic image unit of the MPEG format, is encoded in such a way that a high compression rate is obtainable and thus encoded either as a frame type or a field type by referring to the video data within the macro block. As a result, the encoding type of a macro block does not always coincide with the encoding type of the original source image, as shown in FIGS. 2 and 3.
When a macro block is enlarged in a digital broadcast receiver such as a set-top box or in an optical disk drive such as a DVD player, the enlarged image becomes distorted unless the encoding type of the macro block is the same as that of the original source image, which will be explained in detail with reference to the accompanying drawings.
In FIG. 4, a frame-type original image is enlarged, wherein the original image has 8 black horizontal lines alternate with 8 white horizontal lines and comprises discrete cosine transformed odd-field macro blocks having 8 black horizontal lines and discrete cosine transformed even-field macro blocks having 8 white horizontal lines. Enlarging the macro blocks leads to odd-field macro blocks having 16 black horizontal lines and even-field macro blocks having 16 white horizontal lines.
If the enlarged macro blocks are merged into a frame-type picture, the enlarged picture contains 16 black horizontal lines alternate with 16 white horizontal lines, which is not intended by the enlargement. As a result, if the enlarged picture is displayed by the progressive scan scheme, a completely different image having not 8 black lines but 16 black lines is obtained, which is a problem.
In FIG. 5, a field-type original image is enlarged, wherein the original image has 8 black horizontal lines alternate with 8 white horizontal lines and comprises discrete cosine transformed frame-type macro blocks each having 4 black horizontal lines alternate with 4 white horizontal lines. Enlarging the macro blocks leads to macro blocks each having 16 lines wherein black, gray, white, and gray lines are displayed repeatedly in such order. If these enlarged macro blocks are merged into a field-type picture, the enlarged picture contains 32 horizontal lines having repeated black, gray, white, and gray lines. As a result, if the enlarged picture is displayed by the progressive scan scheme, the odd-field image has alternate black and white lines and the even-field image only has gray lines, which is completely different from the original image.